<template>
    <div class="NumbeRFMaintenMZZZ">
        <div class="pubBig standard ">
            <div class="h0">
                <p class="lt">门诊转诊</p>
            </div>

            <div class="dRightMain">
                <el-tabs v-model="activeName" @tab-click="handleClick">
                    <el-tab-pane label="申请转诊" name="first">
                        <div style="height: 500px;overflow: auto" class="cardP">
                            <el-card class="box-card">
                                <div slot="header" class="clearfix">
                                    <span>患者信息</span>
                                    <button type="button" class="btn btn-primary"
                                            style="float: right; padding: 3px 12px" v-if="false">导入
                                    </button>
                                </div>
                                <div>
                                    <el-row>
                                        <el-col :span="6">
                                            <div class="grid-content bg-purple div_P">
                                                <div class=" form-group ">
                                                    <p>
                                                        <label>申请类型:</label>
                                                        <select class="form-control"
                                                                v-model="ZZInforObj.Referral.TransferType"
                                                                placeholder="请选择">
                                                            <option v-for="(item,index) in hzfsList" :label="item.name"
                                                                    :value="item.code"
                                                                    :key="index"></option>
                                                        </select>
                                                    </p>
                                                </div>
                                            </div>
                                        </el-col>
                                        <el-col :span="6">
                                            <div class="grid-content bg-purple-light div_P">
                                                <div class="form-group">
                                                    <p>
                                                        <label>患者姓名:</label>
                                                        <input type="text" class="form-control"
                                                               v-model="ZZInforObj.PatientInfo.Name" placeholder="必填">
                                                        </input>
                                                    </p>
                                                </div>
                                            </div>
                                        </el-col>
                                        <el-col :span="6">
                                            <div class="grid-content bg-purple div_P">
                                                <div class="form-group">
                                                    <p class="selectTime">
                                                        <label>出生日期:</label>
                                                        <el-date-picker style="width:168px;height:32px"
                                                                        type="date"
                                                                        v-model="ZZInforObj.PatientInfo.Born"
                                                                        value-format="yyyy-MM-dd"
                                                                        placeholder="选择日期">
                                                        </el-date-picker>
                                                    </p>
                                                </div>
                                            </div>
                                        </el-col>
                                        <el-col :span="6">
                                            <div class="grid-content bg-purple-light div_P">
                                                <div class="form-group">
                                                    <p>
                                                        <label>年龄:</label>
                                                        <input type="text" class="form-control" style="width: 120px"
                                                               v-model="ZZInforObj.PatientInfo.Age" placeholder="必填">
                                                        </input>
                                                        <select class="form-control"
                                                                style="width: 80px;margin-left: 20px"
                                                                v-model="ZZInforObj.PatientInfo.AgeUnit"
                                                                placeholder="请选择">
                                                            <option v-for="(item,index) in nldwList" :label="item.name"
                                                                    :value="item.code"
                                                                    :key="index"></option>
                                                        </select>
                                                    </p>
                                                </div>
                                            </div>
                                        </el-col>
                                    </el-row>
                                    <el-row>
                                        <el-col :span="6">
                                            <div class="grid-content bg-purple div_P">
                                                <div class=" form-group ">
                                                    <p>
                                                        <label>性别:</label>
                                                        <select class="form-control"
                                                                v-model="ZZInforObj.PatientInfo.Sex"
                                                                placeholder="请选择">
                                                            <option v-for="(item,index) in xbList" :label="item.name"
                                                                    :value="item.code"
                                                                    :key="index"></option>
                                                        </select>
                                                    </p>
                                                </div>
                                            </div>
                                        </el-col>
                                        <el-col :span="6">
                                            <div class="grid-content bg-purple-light div_P">
                                                <div class="form-group">
                                                    <p>
                                                        <label>体重:</label>
                                                        <input type="text" class="form-control"
                                                               v-model="ZZInforObj.PatientInfo.Weight"
                                                               placeholder="必填">
                                                        </input>
                                                    </p>
                                                </div>
                                            </div>
                                        </el-col>
                                        <el-col :span="6">
                                            <div class="grid-content bg-purple div_P">
                                                <div class="form-group">
                                                    <p class="selectTime">
                                                        <label>身高:</label>
                                                        <input type="text" class="form-control"
                                                               v-model="ZZInforObj.PatientInfo.Height"
                                                               placeholder="必填">
                                                        </input>
                                                    </p>
                                                </div>
                                            </div>
                                        </el-col>
                                        <el-col :span="6">
                                            <div class="grid-content bg-purple-light div_P">
                                                <div class="form-group">
                                                    <p>
                                                        <label>BMI:</label>
                                                        <input type="text" class="form-control"
                                                               v-model="ZZInforObj.PatientInfo.BMI" placeholder="必填">
                                                        </input>
                                                    </p>
                                                </div>
                                            </div>
                                        </el-col>
                                    </el-row>
                                    <el-row>
                                        <el-col :span="6">
                                            <div class="grid-content bg-purple div_P">
                                                <div class=" form-group ">
                                                    <p>
                                                        <label>婚姻情况:</label>
                                                        <select class="form-control"
                                                                v-model="ZZInforObj.PatientInfo.Marital"
                                                                placeholder="请选择">
                                                            <option v-for="(item,index) in hyqkList" :label="item.name"
                                                                    :value="item.code"
                                                                    :key="index"></option>
                                                        </select>
                                                    </p>
                                                </div>
                                            </div>
                                        </el-col>
                                        <el-col :span="6">
                                            <div class="grid-content bg-purple-light div_P">
                                                <div class="form-group">
                                                    <p>
                                                        <label>患者病情:</label>
                                                        <select class="form-control"
                                                                v-model="ZZInforObj.PatientInfo.Condition"
                                                                placeholder="请选择">
                                                            <option v-for="(item,index) in hzbqList" :label="item.name"
                                                                    :value="item.code"
                                                                    :key="index"></option>
                                                        </select>
                                                    </p>
                                                </div>
                                            </div>
                                        </el-col>
                                        <el-col :span="6">
                                            <div class="grid-content bg-purple div_P">
                                                <div class="form-group">
                                                    <p class="selectTime">
                                                        <label>入院时间:</label>
                                                        <el-date-picker style="width:168px;height:32px"
                                                                        type="date"
                                                                        v-model="ZZInforObj.PatientInfo.InDate"
                                                                        value-format="yyyy-MM-dd"
                                                                        placeholder="选择日期">
                                                        </el-date-picker>
                                                    </p>
                                                </div>
                                            </div>
                                        </el-col>
                                        <el-col :span="6">
                                            <div class="grid-content bg-purple-light div_P">
                                                <div class="form-group">
                                                    <p>
                                                        <label>电话:</label>
                                                        <input type="text" class="form-control" style="width: 180px"
                                                               v-model="ZZInforObj.PatientInfo.TelePhone"
                                                               placeholder="必填">
                                                        </input>
                                                    </p>
                                                </div>
                                            </div>
                                        </el-col>
                                    </el-row>

                                    <el-row>
                                        <el-col :span="6">
                                            <div class="grid-content bg-purple div_P">
                                                <div class=" form-group ">
                                                    <p>
                                                        <label>国籍:</label>
                                                        <select class="form-control"
                                                                v-model="ZZInforObj.PatientInfo.Country"
                                                                placeholder="请选择">
                                                            <option v-for="(item,index) in gjList" :label="item.name"
                                                                    :value="item.code"
                                                                    :key="index"></option>
                                                        </select>
                                                    </p>
                                                </div>
                                            </div>
                                        </el-col>
                                        <el-col :span="6">
                                            <div class="grid-content bg-purple-light div_P">
                                                <div class="form-group">
                                                    <p>
                                                        <label>民族:</label>
                                                        <select class="form-control"
                                                                v-model="ZZInforObj.PatientInfo.Nation"
                                                                placeholder="请选择">
                                                            <option v-for="(item,index) in mzList" :label="item.name"
                                                                    :value="item.code"
                                                                    :key="index"></option>
                                                        </select>
                                                    </p>
                                                </div>
                                            </div>
                                        </el-col>
                                        <el-col :span="6">
                                            <div class="grid-content bg-purple div_P">
                                                <div class="form-group">
                                                    <p class="selectTime">
                                                        <label>职业:</label>
                                                        <select class="form-control"
                                                                v-model="ZZInforObj.PatientInfo.Occupation"
                                                                placeholder="请选择">
                                                            <option v-for="(item,index) in zyList" :label="item.name"
                                                                    :value="item.code"
                                                                    :key="index"></option>
                                                        </select>
                                                    </p>
                                                </div>
                                            </div>
                                        </el-col>
                                        <el-col :span="6">
                                            <div class="grid-content bg-purple-light div_P">
                                                <div class="form-group">
                                                    <p>
                                                        <label>地址:</label>
                                                        <input type="text" class="form-control"
                                                               v-model="ZZInforObj.PatientInfo.Address"
                                                               placeholder="必填">
                                                        </input>
                                                    </p>
                                                </div>
                                            </div>
                                        </el-col>
                                    </el-row>
                                    <el-row>
                                        <el-col :span="6">
                                            <div class="grid-content bg-purple div_P">
                                                <div class=" form-group ">
                                                    <p>
                                                        <label>医保类别:</label>
                                                        <select class="form-control"
                                                                v-model="ZZInforObj.PatientInfo.MedicalCatagory"
                                                                placeholder="请选择">
                                                            <option v-for="(item,index) in yblbList" :label="item.name"
                                                                    :value="item.code"
                                                                    :key="index"></option>
                                                        </select>
                                                    </p>
                                                </div>
                                            </div>
                                        </el-col>
                                        <el-col :span="6">
                                            <div class="grid-content bg-purple-light div_P">
                                                <div class="form-group">
                                                    <p>
                                                        <label>医保卡号:</label>
                                                        <input type="text" class="form-control"
                                                               v-model="ZZInforObj.PatientInfo.MedicalCard"
                                                               placeholder="必填">
                                                        </input>
                                                    </p>
                                                </div>
                                            </div>
                                        </el-col>

                                    </el-row>
                                </div>
                            </el-card>
                            <el-card class="box-card">
                                <div slot="header" class="clearfix">
                                    <span>转诊信息</span>
                                    <el-button style="float: right; padding: 3px 0" type="text" v-if="false">操作按钮
                                    </el-button>
                                </div>
                                <div>
                                    <el-row>
                                        <el-col :span="6">
                                            <div class="grid-content bg-purple div_P">
                                                <div class=" form-group ">
                                                    <p>
                                                        <label>接诊医院:</label>
                                                        <select class="form-control" v-model="selectZZJGObj"
                                                                @change="getDeptList"
                                                                placeholder="请选择">
                                                            <option v-for="(item,index) in zzjgList"
                                                                    :label="item.HospitalName"
                                                                    :value="item"
                                                                    :key="index"></option>
                                                        </select>
                                                    </p>
                                                </div>
                                            </div>
                                        </el-col>
                                        <el-col :span="6">
                                            <div class="grid-content bg-purple-light div_P">
                                                <div class="form-group">
                                                    <p>
                                                        <label>接诊科室:</label>
                                                        <select class="form-control" v-model="selectDept"
                                                                placeholder="请选择">
                                                            <option v-for="(item,index) in deptList" :label="item.Name"
                                                                    :value="item"
                                                                    :key="index"></option>
                                                        </select>
                                                    </p>
                                                </div>
                                            </div>
                                        </el-col>
                                        <el-col :span="6">
                                            <div class="grid-content bg-purple-light div_P">
                                                <div class="form-group">

                                                </div>
                                            </div>
                                        </el-col>
                                    </el-row>
                                    <p>
                                        <label>症状描述:</label>
                                        <el-input
                                                type="textarea"
                                                placeholder="请输入内容"
                                                v-model="ZZInforObj.Referral.Condition"
                                                maxlength="30"
                                                show-word-limit
                                        >
                                        </el-input>
                                    </p>
                                </div>
                            </el-card>
                            <el-row>
                                <el-col :span="24">
                                    <div class="grid-content bg-purple ">
                                        <el-card style="width: 100%">
                                            <div slot="header" class="clearfix">
                                                <span>相关附件</span>
                                                <el-button type="success" style="float: right; "
                                                           @click="showDialog('PZ')">
                                                    拍照
                                                    <i class="el-icon-upload el-icon--right"></i>
                                                </el-button>
                                            </div>
                                            <div class="fjtable selectPic">
                                                <el-upload
                                                        ref='upload'
                                                        :auto-upload='false'
                                                        :file-list="fileList"
                                                        :multiple='false'
                                                        :limit="12"
                                                        accept="image/jpeg,image/gif,image/png"
                                                        action=''
                                                        list-type="picture"
                                                        :on-change='changeUpload'
                                                >
                                                    <el-button slot="trigger" size="mini" type="primary">选取图片
                                                    </el-button>
                                                    <span>&nbsp;</span>

                                                </el-upload>
                                            </div>
                                            <el-table
                                                    :data="filePICList"
                                                    style="width: 100%"
                                                    max-height="150">

                                                <el-table-column
                                                        fixed="right"
                                                        label="图片"
                                                >
                                                    <template slot-scope="scope">

                                                        <el-image
                                                                style="width: 80px; height: 80px"
                                                                :src="scope.row.FilePath"
                                                                :fit="fill"></el-image>
                                                    </template>
                                                </el-table-column>


                                                <el-table-column
                                                        fixed="right"
                                                        label="操作"
                                                        width="180">
                                                    <template slot-scope="scope">
                                                        <el-button
                                                                @click.native.prevent="deleteRowPIC(scope.$index, filePICList)"
                                                                type="text"
                                                                size="small">
                                                            移除
                                                        </el-button>
                                                    </template>
                                                </el-table-column>
                                            </el-table>
                                        </el-card>
                                    </div>
                                </el-col>
                            </el-row>
                            <el-row style="margin-top: 16px">
                                <el-col :span="12">
                                    <el-link disabled></el-link>
                                </el-col>
                                <el-col :span="12">
                                    <div class="grid-content bg-purple-light div_P">
                                        <el-button type="success" plain @click="addReferral()">保存</el-button>
                                    </div>
                                </el-col>

                            </el-row>
                        </div>
                    </el-tab-pane>

                    <el-tab-pane label="转诊记录" name="fourth">
                        <div class="cardP">
                            <el-card class="box-card">
                                <div slot="header" class="clearfix">
                                    <span>转诊记录</span>
                                    <el-button style="float: right; padding: 3px 0" type="text" v-if="false">操作按钮
                                    </el-button>
                                    <div style="float: right; padding: 3px 0" v-if="false">
                                        <template>
                                            <el-radio v-model="radioRC" label="1">转入</el-radio>
                                            <el-radio v-model="radioRC" label="2">转出</el-radio>
                                        </template>
                                    </div>

                                </div>
                                <div class="cardC" style="height: 400px;overflow-y: auto">
                                    <el-row>
                                        <el-col :span="8">
                                            <div class="grid-content bg-purple div_P">
                                                <div class="form-group">
                                                    <p class="selectTime">
                                                        <label>申请日期:</label>
                                                        <el-date-picker style="width:98px;height:32px"
                                                                        type="date"
                                                                        v-model="getZZInforObj.bdate"
                                                                        @change="getReferralList()"
                                                                        value-format="yyyy-MM-dd"
                                                                        placeholder="选择日期">
                                                        </el-date-picker>
                                                        -
                                                        <el-date-picker style="width:98px;height:32px"
                                                                        type="date"
                                                                        v-model="getZZInforObj.edate"
                                                                        @change="getReferralList()"
                                                                        value-format="yyyy-MM-dd"
                                                                        placeholder="选择日期">
                                                        </el-date-picker>
                                                    </p>
                                                </div>
                                            </div>
                                        </el-col>
                                        <el-col :span="6">
                                            <template>
                                                <el-radio v-model="radio" label="0" @change="getReferralList()">未接诊
                                                </el-radio>
                                                <el-radio v-model="radio" label="1" @change="getReferralList()">已接诊
                                                </el-radio>
                                            </template>
                                        </el-col>
                                    </el-row>
                                    <el-table
                                            :data="ZZInforList"
                                            height="318"
                                            border
                                            style="width: 100%">
                                        <el-table-column
                                                fixed
                                                prop="PatientName"
                                                label="患者姓名"
                                        >
                                        </el-table-column>
                                        <el-table-column
                                                prop="CreateTime"
                                                label="申请时间"
                                        >
                                        </el-table-column>
                                        <el-table-column
                                                prop="sHospital_Name"
                                                label="接诊医院"
                                        >
                                        </el-table-column>
                                        <el-table-column
                                                prop="sDept_Name"
                                                label="接诊科室"
                                        >
                                        </el-table-column>

                                        <el-table-column
                                                fixed="right"
                                                label="操作"
                                                width="100">
                                            <template slot-scope="scope">
                                                <el-button @click="handleClickJCItem(scope.row)"
                                                           type="text" size="small">查看
                                                </el-button>
                                                <!--                                                <el-button type="text" size="small" v-if="radio==1">删除</el-button>-->
                                            </template>
                                        </el-table-column>
                                    </el-table>
                                    <el-pagination
                                            background
                                            layout="prev, pager, next"
                                            :page-size="10"
                                            @current-change="handleCurrentChange"
                                            :total="total">
                                    </el-pagination>
                                </div>
                            </el-card>
                        </div>
                    </el-tab-pane>
                </el-tabs>
            </div>
            <!--弹框   修改会诊-->
            <div class="blackBg hyCZBg Dilog" v-if="isShow=='UpDateInfor'">
                <div class="panel-default column2">
                    <em class="closes" @click="showDialog('')">×</em>
                    <div class="panel-heading">转诊详情</div>
                    <div style="height: 500px;overflow: auto" class="cardP">
                        <el-card class="box-card">
                            <div slot="header" class="clearfix">
                                <span>患者信息</span>
                                <button type="button" class="btn btn-primary"
                                        style="float: right; padding: 3px 12px" v-if="false">导入
                                </button>
                            </div>
                            <div>
                                <el-row>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple div_P">
                                            <div class=" form-group ">
                                                <p>
                                                    <label>申请类型:</label>
                                                    <select class="form-control"
                                                            v-model="selectZZInforObj.Referral.TransferType"
                                                            placeholder="请选择">
                                                        <option v-for="(item,index) in hzfsList" :label="item.name"
                                                                :value="item.code"
                                                                :key="index"></option>
                                                    </select>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple-light div_P">
                                            <div class="form-group">
                                                <p>
                                                    <label>患者姓名:</label>
                                                    <input type="text" class="form-control"
                                                           v-model="selectZZInforObj.PatientInfo.Name" placeholder="必填">
                                                    </input>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple div_P">
                                            <div class="form-group">
                                                <p class="selectTime">
                                                    <label>出生日期:</label>
                                                    <el-date-picker style="width:98px;height:32px"
                                                                    type="date"
                                                                    v-model="selectZZInforObj.PatientInfo.Born"
                                                                    value-format="yyyy-MM-dd"
                                                                    placeholder="选择日期">
                                                    </el-date-picker>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple-light div_P">
                                            <div class="form-group">
                                                <p>
                                                    <label>年龄:</label>
                                                    <input type="text" class="form-control"
                                                           style="width: 60px!important;"
                                                           v-model="selectZZInforObj.PatientInfo.Age" placeholder="必填">
                                                    </input>
                                                    <select class="form-control"
                                                            style="width: 50px!important;margin-left: 10px"
                                                            v-model="selectZZInforObj.PatientInfo.AgeUnit"
                                                            placeholder="请选择">
                                                        <option v-for="(item,index) in nldwList" :label="item.name"
                                                                :value="item.code"
                                                                :key="index"></option>
                                                    </select>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>
                                </el-row>
                                <el-row>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple div_P">
                                            <div class=" form-group ">
                                                <p>
                                                    <label>性别:</label>
                                                    <select class="form-control"
                                                            v-model="selectZZInforObj.PatientInfo.Sex"
                                                            placeholder="请选择">
                                                        <option v-for="(item,index) in xbList" :label="item.name"
                                                                :value="item.code"
                                                                :key="index"></option>
                                                    </select>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple-light div_P">
                                            <div class="form-group">
                                                <p>
                                                    <label>体重:</label>
                                                    <input type="text" class="form-control"
                                                           v-model="selectZZInforObj.PatientInfo.Weight"
                                                           placeholder="必填">
                                                    </input>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple div_P">
                                            <div class="form-group">
                                                <p class="selectTime">
                                                    <label>身高:</label>
                                                    <input type="text" class="form-control"
                                                           v-model="selectZZInforObj.PatientInfo.Height"
                                                           placeholder="必填">
                                                    </input>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple-light div_P">
                                            <div class="form-group">
                                                <p>
                                                    <label>BMI:</label>
                                                    <input type="text" class="form-control"
                                                           v-model="selectZZInforObj.PatientInfo.BMI" placeholder="必填">
                                                    </input>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>
                                </el-row>
                                <el-row>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple div_P">
                                            <div class=" form-group ">
                                                <p>
                                                    <label>婚姻情况:</label>
                                                    <select class="form-control"
                                                            v-model="selectZZInforObj.PatientInfo.Marital"
                                                            placeholder="请选择">
                                                        <option v-for="(item,index) in hyqkList" :label="item.name"
                                                                :value="item.code"
                                                                :key="index"></option>
                                                    </select>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple-light div_P">
                                            <div class="form-group">
                                                <p>
                                                    <label>患者病情:</label>
                                                    <select class="form-control"
                                                            v-model="selectZZInforObj.PatientInfo.Condition"
                                                            placeholder="请选择">
                                                        <option v-for="(item,index) in hzbqList" :label="item.name"
                                                                :value="item.code"
                                                                :key="index"></option>
                                                    </select>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple div_P">
                                            <div class="form-group">
                                                <p class="selectTime">
                                                    <label>入院时间:</label>
                                                    <el-date-picker style="width:98px;height:32px"
                                                                    type="date"
                                                                    v-model="selectZZInforObj.PatientInfo.InDate"
                                                                    value-format="yyyy-MM-dd"
                                                                    placeholder="选择日期">
                                                    </el-date-picker>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple-light div_P">
                                            <div class="form-group">
                                                <p>
                                                    <label>电话:</label>
                                                    <input type="text" class="form-control" style="width: 98px"
                                                           v-model="selectZZInforObj.PatientInfo.TelePhone"
                                                           placeholder="必填">
                                                    </input>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>
                                </el-row>

                                <el-row>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple div_P">
                                            <div class=" form-group ">
                                                <p>
                                                    <label>国籍:</label>
                                                    <select class="form-control"
                                                            v-model="selectZZInforObj.PatientInfo.Country"
                                                            placeholder="请选择">
                                                        <option v-for="(item,index) in gjList" :label="item.name"
                                                                :value="item.code"
                                                                :key="index"></option>
                                                    </select>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple-light div_P">
                                            <div class="form-group">
                                                <p>
                                                    <label>民族:</label>
                                                    <select class="form-control"
                                                            v-model="selectZZInforObj.PatientInfo.Nation"
                                                            placeholder="请选择">
                                                        <option v-for="(item,index) in mzList" :label="item.name"
                                                                :value="item.code"
                                                                :key="index"></option>
                                                    </select>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple div_P">
                                            <div class="form-group">
                                                <p class="selectTime">
                                                    <label>职业:</label>
                                                    <select class="form-control"
                                                            v-model="selectZZInforObj.PatientInfo.Occupation"
                                                            placeholder="请选择">
                                                        <option v-for="(item,index) in zyList" :label="item.name"
                                                                :value="item.code"
                                                                :key="index"></option>
                                                    </select>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple-light div_P">
                                            <div class="form-group">
                                                <p>
                                                    <label>地址:</label>
                                                    <input type="text" class="form-control"
                                                           v-model="selectZZInforObj.PatientInfo.Address"
                                                           placeholder="必填">
                                                    </input>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>
                                </el-row>
                                <el-row>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple div_P">
                                            <div class=" form-group ">
                                                <p>
                                                    <label>医保类别:</label>
                                                    <select class="form-control"
                                                            v-model="selectZZInforObj.PatientInfo.MedicalCatagory"
                                                            placeholder="请选择">
                                                        <option v-for="(item,index) in yblbList" :label="item.name"
                                                                :value="item.code"
                                                                :key="index"></option>
                                                    </select>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple-light div_P">
                                            <div class="form-group">
                                                <p>
                                                    <label>医保卡号:</label>
                                                    <input type="text" class="form-control"
                                                           v-model="selectZZInforObj.PatientInfo.MedicalCard"
                                                           placeholder="必填">
                                                    </input>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>

                                </el-row>
                            </div>
                        </el-card>
                        <el-card class="box-card">
                            <div slot="header" class="clearfix">
                                <span>转诊信息</span>
                                <el-button style="float: right; padding: 3px 0" type="text" v-if="false">操作按钮
                                </el-button>
                            </div>
                            <div>
                                <el-row>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple div_P">
                                            <div class=" form-group ">
                                                <p>
                                                    <label>接诊医院:</label>
                                                    <select class="form-control" v-model="selectZZJGObj"
                                                            @change="getDeptList"
                                                            placeholder="请选择">
                                                        <option v-for="(item,index) in zzjgList"
                                                                :label="item.HospitalName"
                                                                :value="item"
                                                                :key="index"></option>
                                                    </select>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple-light div_P">
                                            <div class="form-group">
                                                <p>
                                                    <label>接诊科室:</label>
                                                    <select class="form-control" v-model="selectDept"
                                                            placeholder="请选择">
                                                        <option v-for="(item,index) in deptList" :label="item.Name"
                                                                :value="item"
                                                                :key="index"></option>
                                                    </select>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple-light div_P">
                                            <div class="form-group">

                                            </div>
                                        </div>
                                    </el-col>
                                </el-row>
                                <p>
                                    <label>症状描述:</label>
                                    <el-input
                                            type="textarea"
                                            placeholder="请输入内容"
                                            v-model="selectZZInforObj.Referral.Condition"
                                            maxlength="30"
                                            show-word-limit
                                    >
                                    </el-input>
                                </p>
                            </div>
                        </el-card>
                        <el-row style="margin-top: 16px">
                            <el-col :span="12">
                                <el-link disabled></el-link>
                            </el-col>
                            <el-col :span="12">
                                <div class="grid-content bg-purple-light div_P">
                                    <el-button type="success" plain @click="addReferral()">保存</el-button>
                                </div>
                            </el-col>

                        </el-row>
                    </div>
                </div>
            </div>
            <!--弹框  会诊详情-->
            <div class="blackBg hyCZBg Dilog" v-if="isShow=='Infor'">
                <div class="panel-default column2">
                    <em class="closes" @click="showDialog('')">×</em>
                    <div class="panel-heading">转诊详情</div>
                    <div style="height: 500px;overflow: auto" class="cardP">
                        <el-card class="box-card">
                            <div slot="header" class="clearfix">
                                <span>患者信息</span>
                                <button type="button" class="btn btn-primary"
                                        style="float: right; padding: 3px 12px" v-if="false">导入
                                </button>
                            </div>
                            <div>
                                <el-row>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple div_P">
                                            <div class=" form-group ">
                                                <p>
                                                    <label>申请类型:</label>
                                                    <select class="form-control"
                                                            disabled disabled
                                                            v-model="selectZZInforObj.Referral.TransferType"
                                                            placeholder="请选择">
                                                        <option v-for="(item,index) in hzfsList" :label="item.name"
                                                                :value="item.code"
                                                                :key="index"></option>
                                                    </select>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple-light div_P">
                                            <div class="form-group">
                                                <p>
                                                    <label>患者姓名:</label>
                                                    <input type="text" class="form-control"
                                                           disabled v-model="selectZZInforObj.PatientInfo.Name"
                                                           placeholder="必填">
                                                    </input>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple div_P">
                                            <div class="form-group">
                                                <p class="selectTime">
                                                    <label>出生日期:</label>
                                                    <el-date-picker style="width:98px;height:32px"
                                                                    type="date"
                                                                    disabled v-model="selectZZInforObj.PatientInfo.Born"
                                                                    value-format="yyyy-MM-dd"
                                                                    placeholder="选择日期">
                                                    </el-date-picker>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple-light div_P">
                                            <div class="form-group">
                                                <p>
                                                    <label>年龄:</label>
                                                    <input type="text" class="form-control"
                                                           style="width: 60px!important;"
                                                           disabled v-model="selectZZInforObj.PatientInfo.Age"
                                                           placeholder="必填">
                                                    </input>
                                                    <select class="form-control"
                                                            style="width: 50px!important;margin-left: 10px"
                                                            disabled v-model="selectZZInforObj.PatientInfo.AgeUnit"
                                                            placeholder="请选择">
                                                        <option v-for="(item,index) in nldwList" :label="item.name"
                                                                :value="item.code"
                                                                :key="index"></option>
                                                    </select>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>
                                </el-row>
                                <el-row>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple div_P">
                                            <div class=" form-group ">
                                                <p>
                                                    <label>性别:</label>
                                                    <select class="form-control"
                                                            disabled v-model="selectZZInforObj.PatientInfo.Sex"
                                                            placeholder="请选择">
                                                        <option v-for="(item,index) in xbList" :label="item.name"
                                                                :value="item.code"
                                                                :key="index"></option>
                                                    </select>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple-light div_P">
                                            <div class="form-group">
                                                <p>
                                                    <label>体重:</label>
                                                    <input type="text" class="form-control"
                                                           disabled v-model="selectZZInforObj.PatientInfo.Weight"
                                                           placeholder="必填">
                                                    </input>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple div_P">
                                            <div class="form-group">
                                                <p class="selectTime">
                                                    <label>身高:</label>
                                                    <input type="text" class="form-control"
                                                           disabled v-model="selectZZInforObj.PatientInfo.Height"
                                                           placeholder="必填">
                                                    </input>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple-light div_P">
                                            <div class="form-group">
                                                <p>
                                                    <label>BMI:</label>
                                                    <input type="text" class="form-control"
                                                           disabled v-model="selectZZInforObj.PatientInfo.BMI"
                                                           placeholder="必填">
                                                    </input>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>
                                </el-row>
                                <el-row>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple div_P">
                                            <div class=" form-group ">
                                                <p>
                                                    <label>婚姻情况:</label>
                                                    <select class="form-control"
                                                            disabled v-model="selectZZInforObj.PatientInfo.Marital"
                                                            placeholder="请选择">
                                                        <option v-for="(item,index) in hyqkList" :label="item.name"
                                                                :value="item.code"
                                                                :key="index"></option>
                                                    </select>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple-light div_P">
                                            <div class="form-group">
                                                <p>
                                                    <label>患者病情:</label>
                                                    <select class="form-control"
                                                            disabled v-model="selectZZInforObj.PatientInfo.Condition"
                                                            placeholder="请选择">
                                                        <option v-for="(item,index) in hzbqList" :label="item.name"
                                                                :value="item.code"
                                                                :key="index"></option>
                                                    </select>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple div_P">
                                            <div class="form-group">
                                                <p class="selectTime">
                                                    <label>入院时间:</label>
                                                    <el-date-picker style="width:98px;height:32px"
                                                                    type="date"
                                                                    disabled
                                                                    v-model="selectZZInforObj.PatientInfo.InDate"
                                                                    value-format="yyyy-MM-dd"
                                                                    placeholder="选择日期">
                                                    </el-date-picker>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple-light div_P">
                                            <div class="form-group">
                                                <p>
                                                    <label>电话:</label>
                                                    <input type="text" class="form-control" style="width: 98px"
                                                           disabled v-model="selectZZInforObj.PatientInfo.TelePhone"
                                                           placeholder="必填">
                                                    </input>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>
                                </el-row>

                                <el-row>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple div_P">
                                            <div class=" form-group ">
                                                <p>
                                                    <label>国籍:</label>
                                                    <select class="form-control"
                                                            disabled v-model="selectZZInforObj.PatientInfo.Country"
                                                            placeholder="请选择">
                                                        <option v-for="(item,index) in gjList" :label="item.name"
                                                                :value="item.code"
                                                                :key="index"></option>
                                                    </select>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple-light div_P">
                                            <div class="form-group">
                                                <p>
                                                    <label>民族:</label>
                                                    <select class="form-control"
                                                            disabled v-model="selectZZInforObj.PatientInfo.Nation"
                                                            placeholder="请选择">
                                                        <option v-for="(item,index) in mzList" :label="item.name"
                                                                :value="item.code"
                                                                :key="index"></option>
                                                    </select>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple div_P">
                                            <div class="form-group">
                                                <p class="selectTime">
                                                    <label>职业:</label>
                                                    <select class="form-control"
                                                            disabled v-model="selectZZInforObj.PatientInfo.Occupation"
                                                            placeholder="请选择">
                                                        <option v-for="(item,index) in zyList" :label="item.name"
                                                                :value="item.code"
                                                                :key="index"></option>
                                                    </select>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple-light div_P">
                                            <div class="form-group">
                                                <p>
                                                    <label>地址:</label>
                                                    <input type="text" class="form-control"
                                                           disabled v-model="selectZZInforObj.PatientInfo.Address"
                                                           placeholder="必填">
                                                    </input>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>
                                </el-row>
                                <el-row>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple div_P">
                                            <div class=" form-group ">
                                                <p>
                                                    <label>医保类别:</label>
                                                    <select class="form-control"
                                                            disabled
                                                            v-model="selectZZInforObj.PatientInfo.MedicalCatagory"
                                                            placeholder="请选择">
                                                        <option v-for="(item,index) in yblbList" :label="item.name"
                                                                :value="item.code"
                                                                :key="index"></option>
                                                    </select>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple-light div_P">
                                            <div class="form-group">
                                                <p>
                                                    <label>医保卡号:</label>
                                                    <input type="text" class="form-control"
                                                           disabled v-model="selectZZInforObj.PatientInfo.MedicalCard"
                                                           placeholder="必填">
                                                    </input>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>

                                </el-row>
                            </div>
                        </el-card>
                        <el-card class="box-card">
                            <div slot="header" class="clearfix">
                                <span>转诊信息</span>
                                <el-button style="float: right; padding: 3px 0" type="text" v-if="false">操作按钮
                                </el-button>
                            </div>
                            <div>
                                <el-row>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple div_P">
                                            <div class=" form-group ">
                                                <p>
                                                    <label>接诊医院:</label>
                                                    <select class="form-control" v-model="selectZZJGObj"
                                                            @change="getDeptList"
                                                            disabled
                                                            placeholder="请选择">
                                                        <option v-for="(item,index) in zzjgList"
                                                                :label="item.HospitalName"
                                                                :value="item"
                                                                :key="index"></option>
                                                    </select>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple-light div_P">
                                            <div class="form-group">
                                                <p>
                                                    <label>接诊科室:</label>
                                                    <select class="form-control" v-model="selectDept"
                                                            disabled
                                                            placeholder="请选择">
                                                        <option v-for="(item,index) in deptList" :label="item.Name"
                                                                :value="item"
                                                                :key="index"></option>
                                                    </select>
                                                </p>
                                            </div>
                                        </div>
                                    </el-col>
                                    <el-col :span="6">
                                        <div class="grid-content bg-purple-light div_P">
                                            <div class="form-group">

                                            </div>
                                        </div>
                                    </el-col>
                                </el-row>
                                <p>
                                    <label>症状描述:</label>
                                    <el-input
                                            type="textarea"
                                            placeholder="请输入内容"
                                            disabled
                                            v-model="selectZZInforObj.Referral.Condition"
                                            maxlength="30"
                                            show-word-limit
                                    >
                                    </el-input>
                                </p>
                            </div>
                        </el-card>
                        <el-row>
                            <el-col :span="24">
                                <div class="grid-content bg-purple ">
                                    <el-card style="width: 100%">
                                        <div slot="header" class="clearfix">
                                            <span>相关检查附件</span>
                                            <el-button type="success" v-if="false"
                                                       style="float: right; padding: 3px 0">上传
                                                <i class="el-icon-upload el-icon--right"></i>
                                            </el-button>
                                        </div>
                                        <div class="fjtable">
                                            <el-table
                                                    :data="selectZZInforObj.Referral_Files"
                                                    height="112"
                                                    border
                                                    style="width: 100%">
                                                <el-table-column
                                                        fixed
                                                        prop="ConsultId"
                                                        label="时间"
                                                >
                                                </el-table-column>
                                                <el-table-column
                                                        prop="FilePath"
                                                        label="附件名称"
                                                >
                                                </el-table-column>


                                                <el-table-column
                                                        fixed="right"
                                                        label="操作"
                                                        width="100">
                                                    <template slot-scope="scope">
                                                        <el-button
                                                                @click="handleClickPICItem(scope.row)"
                                                                type="text" size="small">查看
                                                        </el-button>
                                                        <el-button type="text" size="small"
                                                                   v-if="false">删除
                                                        </el-button>
                                                    </template>
                                                </el-table-column>
                                            </el-table>
                                        </div>


                                    </el-card>
                                </div>
                            </el-col>
                        </el-row>
                        <el-row style="margin-top: 16px">
                            <el-col :span="12">
                                <el-link disabled></el-link>
                            </el-col>
                            <el-col :span="12">
                                <div class="grid-content bg-purple-light div_P">
<!--                                    LoginInfor.SectionId==selectZZInforObj.Referral.sDept&&-->
                                    <el-button type="success" v-if="LoginInfor.HospitalId==selectZZInforObj.Referral.sHospital&&radio==0" plain @click="updateReferral(1)">接诊</el-button>
                                </div>
                            </el-col>

                        </el-row>
                    </div>
                </div>
            </div>
            <!--            拍照弹框-->
            <div class="blackBg hyCZBg" v-if="isShow=='PZ'">
                <div class="panel-default column2">
                    <em class="closes" @click=" showDialog('')">×</em>
                    <div class="panel-heading">拍照</div>
                    <div class="pucLabel">
                        <div class="camera_outer">
                            <video id="videoCamera" :width="videoWidth" :height="videoHeight" autoplay></video>
                            <canvas id="canvasCamera" :width="videoWidth"
                                    :height="videoHeight"></canvas>
                            <div v-if="imgSrc!=''" class="img_bg_camera">
                                <img :src="imgSrc" alt="" class="tx_img">
                            </div>
                            <button @click="getCompetence()">打开摄像头</button>
                            <button @click="stopNavigator()">关闭摄像头</button>
                            <button @click="setImage()">拍照</button>
                        </div>
                    </div>

                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" @click="showDialog('')">关闭</button>
                        <button type="button" class="btn btn-primary" @click="okImage()">保存</button>
                    </div>
                </div>
            </div>
            <!--            附件详情-->
            <div class="blackBg hyCZBg" v-if="isShow=='PIC'">
                <div class="panel-default column2">
                    <em class="closes" @click="showDialog('Infor')">×</em>
                    <div class="panel-heading">附件详情</div>
                    <div class="pucLabel">
                        <div class="camera_outer">
                            <el-image
                                    style="width: 1100px; height: 420px"
                                    :src="imgSrcUrl"
                                    :fit="fit"></el-image>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" @click="showDialog('Infor')">关闭</button>

                    </div>
                </div>
            </div>
        </div>
    </div>
</template>
<script>
    export default {
        name: "Bedinformation",
        data() {
            return {
                msg: "SystemManagement 下的 Bedinformation",
                activeName: 'first',
                hzfsList: [
                    {name: '一般转诊', code: "1"},
                    {name: '紧急转诊', code: "2"},
                ],//会诊方式
                //年龄单位
                nldwList: [
                    {name: '岁', code: "1"},
                    {name: '月', code: "2"},
                    {name: '天', code: "3"},
                ],
                //性别
                xbList: [
                    {name: '男', code: "1"},
                    {name: '女', code: "2"},
                    {name: '未知', code: "3"},
                ],
                //婚姻情况
                hyqkList: [
                    {name: '未婚', code: "1"},
                    {name: '已婚', code: "2"},
                    {name: '离异', code: "3"},
                ],
                //患者病情
                hzbqList: [
                    {name: '一般', code: "1"},
                    {name: '紧急', code: "2"},
                    {name: '病危', code: "3"},
                ],
                //医保类别
                yblbList: [
                    {name: '自费', code: "1"},
                    {name: '居民医保', code: "2"},
                    {name: '职工医保', code: "3"},
                ],
                //就诊类型
                jzlxList: [
                    {name: '门诊', code: "1"},
                    {name: '住院', code: "2"},
                ],
                //国籍
                gjList: [
                    {name: '中国', code: "1"},
                    {name: '外籍', code: "2"},
                ],
                //民族
                mzList: [
                    {name: '汉族', code: "1"},
                    {name: '其他少数民族', code: "2"},
                ],
                //职业
                zyList: [
                    {name: '自由职业', code: "1"},
                    {name: '其他', code: "2"},
                ],

                radio: '0',
                radioRC: "1",
                textarea: '',
                tableData: [
                    {
                        date: '2016-05-02',
                        name: '王小虎',
                        province: '上海',
                        city: '普陀区',
                        address: '上海市普陀区金沙江路 1518 弄',
                        zip: 200333
                    }, {
                        date: '2016-05-04',
                        name: '王小虎',
                        province: '上海',
                        city: '普陀区',
                        address: '上海市普陀区金沙江路 1517 弄',
                        zip: 200333
                    }, {
                        date: '2016-05-01',
                        name: '王小虎',
                        province: '上海',
                        city: '普陀区',
                        address: '上海市普陀区金沙江路 1519 弄',
                        zip: 200333
                    }, {
                        date: '2016-05-03',
                        name: '王小虎',
                        province: '上海',
                        city: '普陀区',
                        address: '上海市普陀区金沙江路 1516 弄',
                        zip: 200333
                    }],
                /****************图片附件************************/
                filePICList: [],
                fileList: [],
                imgSrcUrl: "",
                /**************************************拍照****************************************/
                videoWidth: 300,
                videoHeight: 300,
                imgSrc: '',
                thisCancas: null,
                thisContext: null,
                thisVideo: null,
                /*************************转诊相关**********************************/
                LoginInfor: {},
                isShow: "",
                zzjgList: [],
                deptList: [],
                selectDept: {},
                selectZZJGObj: {},
                ZZInforObj: {
                    PatientInfo: {
                        /// 申请类别
                        Catagory: "0",
                        /// 患者编号
                        PatientId: "-1",
                        /// 身份证号
                        IDCard: "",
                        /// 姓名
                        Name: "",
                        /// 性别
                        Sex: "1",
                        /// 年龄
                        Age: "",
                        /// 年龄单位
                        AgeUnit: "1",
                        /// 婚姻状况
                        Marital: "1",
                        /// 患者病情
                        Condition: "1",
                        /// 体重
                        Weight: "",
                        /// 身高
                        Height: "",
                        /// 体重指数
                        BMI: "",
                        /// 国籍
                        Country: "1",
                        /// 民族
                        Nation: "1",
                        /// 出生日期
                        Born: "",
                        /// 医保类型
                        MedicalCatagory: "1",
                        /// 医保卡号
                        MedicalCard: "",
                        /// 联系电话
                        TelePhone: "",
                        /// 职业
                        Occupation: "1",
                        /// 地址
                        Address: "",
                        /// 就诊类型
                        SeekCatagory: "1",
                        /// 入院时间
                        InDate: "",
                    },
                    Referral: {
                        Id: "-1",
                        BigType: "0",//会诊类别//0门诊，1住院
                        rHospital: "",//申请医院
                        rDept: "",//申请科室
                        rDoctor: "",//申请医生
                        sHospital: "-1",//接诊医院
                        sDept: "",//接诊科室
                        sDoctor: "",//接诊医生
                        PatientId: "-1",//患者id
                        PatientName: "",//姓名名称
                        Condition: "",//患者状况
                        Diagnosis: "",//诊断
                        TransferType: "-1",//转诊状态
                        ExpectTime: "2019-12-01",//接诊时间
                        TransferAim: "-1",
                        CreateTime: "2019-12-01",//申请时间
                        CreateId: "-1",//创建人ID
                        Status: "-1",//状态
                    },
                    Referral_Diagnosis: [],
                    Referral_Files: []
                },
                selectZZInforObj: {
                    PatientInfo: {
                        /// 申请类别
                        Catagory: "1",
                        /// 患者编号
                        PatientId: "-1",
                        /// 身份证号
                        IDCard: "",
                        /// 姓名
                        Name: "",
                        /// 性别
                        Sex: "1",
                        /// 年龄
                        Age: "",
                        /// 年龄单位
                        AgeUnit: "1",
                        /// 婚姻状况
                        Marital: "1",
                        /// 患者病情
                        Condition: "1",
                        /// 体重
                        Weight: "",
                        /// 身高
                        Height: "",
                        /// 体重指数
                        BMI: "",
                        /// 国籍
                        Country: "1",
                        /// 民族
                        Nation: "1",
                        /// 出生日期
                        Born: "",
                        /// 医保类型
                        MedicalCatagory: "1",
                        /// 医保卡号
                        MedicalCard: "",
                        /// 联系电话
                        TelePhone: "",
                        /// 职业
                        Occupation: "1",
                        /// 地址
                        Address: "",
                        /// 就诊类型
                        SeekCatagory: "1",
                        /// 入院时间
                        InDate: "",
                    },
                    Referral: {
                        Id: "-1",
                        BigType: "-1",//会诊类别
                        rHospital: "",//申请医院
                        rDept: "",//申请科室
                        rDoctor: "",//申请医生
                        sHospital: "-1",//接诊医院
                        sDept: "",//接诊科室
                        sDoctor: "",//接诊医生
                        PatientId: "-1",//患者id
                        PatientName: "",//姓名名称
                        Condition: "",//患者状况
                        Diagnosis: "",//诊断
                        TransferType: "-1",//转诊状态
                        ExpectTime: "2019-12-01",//接诊时间
                        TransferAim: "-1",
                        CreateTime: "2019-12-01",//申请时间
                        CreateId: "-1",//创建人ID
                        Status: "-1",//状态
                    },
                    Referral_Diagnosis: [],
                    Referral_Files: []
                },
                ZZInforList: [],
                getZZInforObj: {
                    bigtype: "0",//0门诊 1住院
                    rhospital: "-1",//转出医院编号(全部则传-1)
                    shospital: "-1",//转入医院编号(全部则传-1)
                    bdate: "",//申请开始日期(yyyy-MM-dd)
                    edate: "",//申请截止日期(yyyy-MM-dd)
                    patname: "",//患者姓名
                    status: "",//状态码(全部则传-1)
                    page: "0",//页码,默认0
                    limit: "10",//每页数量,默认10
                },
                total: 1,
                /********附件详情图片**************/
                fit:"fill",
            };
        },
        methods: {
            showDialog(show) {
                this.isShow = show
            },
            handleClick(tab, event) {
                console.log(tab, event);
                this.getReferralList();
            },
            handleClickJCItem(row) {
                console.log(row);
                this.getReferralInfor(row.Id)
            },
            handleClickInforItem(row) {
                console.log(row);
                this.showDialog("Infor")
            },
            /****************************************远程会诊***********************************************************/
            handleCurrentChange(val) {
                console.log(`当前页: ${val}`);
                this.getZZInforObj.page = val;
                this.getReferralList()
            },
            addReferral() {
                if (this.selectZZJGObj.HospitalId == "") {
                    this.$message({
                        showClose: true,
                        message: "请选择接诊医院！",
                        type: "error"
                    });
                    return
                }
                if (this.selectDept.Id == "") {
                    this.$message({
                        showClose: true,
                        message: "请选择接诊科室！",
                        type: "error"
                    });
                    return
                }
                this.ZZInforObj.Referral.BigType = 0;//0门诊，1住院
                this.ZZInforObj.Referral.rHospital = this.LoginInfor.HospitalId
                this.ZZInforObj.Referral.rDoctor = this.LoginInfor.UserId;
                this.ZZInforObj.Referral.rDept = this.LoginInfor.DeptId;
                this.ZZInforObj.Referral.sHospital = this.selectZZJGObj.HospitalId;//接诊医院
                this.ZZInforObj.Referral.sDept = this.selectDept.Id;//接诊科室
                this.ZZInforObj.Referral.PatientName = this.ZZInforObj.PatientInfo.Name;
                for(var i=0;i<this.filePICList.length;i++){
                    this.filePICList[i].FilePath=this.filePICList[i].FilePath.toString().substr(this.filePICList[i].FilePath.toString().indexOf(',') + 1);
                }
                this.ZZInforObj.Referral_Files=this.filePICList;
                var params = this.ZZInforObj;
                //POST /api/RerferralBuss/Create
                this.$post("RerferralBuss/Create", params)
                    .then(res => {
                        console.log("新增转诊结果");
                        console.log(res);
                        if (res.code == 0) {
                            this.ZZInforObj = {
                                PatientInfo: {
                                    /// 申请类别
                                    Catagory: "1",
                                    /// 患者编号
                                    PatientId: "-1",
                                    /// 身份证号
                                    IDCard: "",
                                    /// 姓名
                                    Name: "",
                                    /// 性别
                                    Sex: "1",
                                    /// 年龄
                                    Age: "",
                                    /// 年龄单位
                                    AgeUnit: "1",
                                    /// 婚姻状况
                                    Marital: "1",
                                    /// 患者病情
                                    Condition: "1",
                                    /// 体重
                                    Weight: "",
                                    /// 身高
                                    Height: "",
                                    /// 体重指数
                                    BMI: "",
                                    /// 国籍
                                    Country: "1",
                                    /// 民族
                                    Nation: "1",
                                    /// 出生日期
                                    Born: "",
                                    /// 医保类型
                                    MedicalCatagory: "1",
                                    /// 医保卡号
                                    MedicalCard: "",
                                    /// 联系电话
                                    TelePhone: "",
                                    /// 职业
                                    Occupation: "1",
                                    /// 地址
                                    Address: "",
                                    /// 就诊类型
                                    SeekCatagory: "1",
                                    /// 入院时间
                                    InDate: "",
                                },
                                Referral: {
                                    Id: "-1",
                                    BigType: "-1",//会诊类别
                                    rHospital: "",//申请医院
                                    rDept: "",//申请科室
                                    rDoctor: "",//申请医生
                                    sHospital: "-1",//接诊医院
                                    sDept: "",//接诊科室
                                    sDoctor: "",//接诊医生
                                    PatientId: "-1",//患者id
                                    PatientName: "",//姓名名称
                                    Condition: "",//患者状况
                                    Diagnosis: "",//诊断
                                    TransferType: "-1",//转诊状态
                                    ExpectTime: "",//接诊时间
                                    TransferAim: "-1",
                                    CreateTime: "2019-12-01",//申请时间
                                    CreateId: "-1",//创建人ID
                                    Status: "-1",//状态
                                },
                            };
                            this.selectZZJGObj = {};
                            this.selectDept = {};
                        }
                    })
                    .catch(err => {
                        console.log(err);
                    });
            },
            updateReferral(Status) {
                var params = {
                    ReferralId:this.selectZZInforObj.Referral.Id,
                    Status:Status
                };
                //POST /api/RerferralBuss/ChangeConsultStatus
                this.$post("RerferralBuss/ChangeConsultStatus", params)
                    .then(res => {
                        console.log("更改状态结果");
                        console.log(res);
                        if (res.code == 0) {
                           this.getReferralList();
                            this.showDialog("");
                        }
                    })
                    .catch(err => {
                        console.log(err);
                    });
            },
            getReferralList() {
                this.ZZInforList = [];
                this.getZZInforObj.status = this.radio;
                var params = this.getZZInforObj;
                this.$get("RerferralBuss/GetList", params)
                    .then(res => {
                        console.log("转诊列表查询结果");
                        console.log(res);
                        if (res.code == 0) {
                            this.total = res.data.TotalCount
                            this.ZZInforList = res.data.list[0].Table;
                        }
                    })
                    .catch(err => {
                        console.log(err);
                    });
            },
            //
            getReferralInfor(Id) {
                var params = {
                    ReferralId: Id
                };
                this.$get("RerferralBuss/Get", params)
                    .then(res => {
                        console.log("转诊明细查询结果");
                        console.log(res);
                        if (res.code == 0) {
                            this.selectZZInforObj = res.data
                            this.showDialog("Infor")
                            // if (this.radio == 1) {
                            //     this.showDialog("UpDateInfor")
                            // } else {
                            //     this.showDialog("Infor")
                            // }
                        }
                    })
                    .catch(err => {
                        console.log(err);
                    });
            },
            getZZJGList() {
                this.zzjgList = [];
                var params = {
                    name: ""
                };
                this.$get("Hospital/GetList", params)
                    .then(res => {
                        //this.total = res.data.totalCount;
                        this.zzjgList = res.data;
                        if (this.zzjgList.length > 0) {
                            this.selectZZJGObj = this.zzjgList[0];
                            this.getDeptList();
                        }
                        console.log("组织机构列表查询结果");
                        console.log(res);
                    })
                    .catch(err => {
                        console.log(err);
                    });
            },
            getDeptList() {
                if (this.selectZZJGObj.HospitalId == "") {
                    this.$message({
                        showClose: true,
                        message: "请选择接诊医院！",
                        type: "error"
                    });
                    return
                }
                var params = {
                    HospitalId: this.selectZZJGObj.HospitalId,
                    name: ""
                };
                this.$get("Dept/GetList", params)
                    .then(res => {
                        this.deptList = res.data;
                        console.log("科室列表查询结果");
                        console.log(res);
                    })
                    .catch(err => {
                        console.log(err);
                    });
            },
            /*****************附件上传*******************/
            changeUpload(file, fileList) {
                console.log("选择照片改变时")
                console.log(file)
                console.log(fileList)
                var That = this;
                var imgFile;
                var reader = new FileReader();     //html5读文件
                reader.readAsDataURL(file.raw); //转BASE64
                reader.onload = function (e) {        //读取完毕后调用接口
                    imgFile = e.target.result;
                    console.log("Base64图片：");
                    console.log(imgFile);
                    var Consult_File = {
                        Id: 0,
                        ConsultId: 0,
                        Code: "string",
                        FilePath: imgFile,
                        ImgType: 0
                    }
                    That.filePICList.push(Consult_File);
                };
            },
            deleteRowPIC(index, rows) {
                rows.splice(index, 1);
            },
            /**********************************拍照****************************/
// 调用权限（打开摄像头功能）
            getCompetence() {
                var _this = this
                this.thisCancas = document.getElementById('canvasCamera')
                this.thisContext = this.thisCancas.getContext('2d')
                this.thisVideo = document.getElementById('videoCamera')
                // 旧版本浏览器可能根本不支持mediaDevices，我们首先设置一个空对象
                if (navigator.mediaDevices === undefined) {
                    navigator.mediaDevices = {}
                }
                // 一些浏览器实现了部分mediaDevices，我们不能只分配一个对象
                // 使用getUserMedia，因为它会覆盖现有的属性。
                // 这里，如果缺少getUserMedia属性，就添加它。
                if (navigator.mediaDevices.getUserMedia === undefined) {
                    navigator.mediaDevices.getUserMedia = function (constraints) {
                        // 首先获取现存的getUserMedia(如果存在)
                        var getUserMedia = navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.getUserMedia
                        // 有些浏览器不支持，会返回错误信息
                        // 保持接口一致
                        if (!getUserMedia) {
                            return Promise.reject(new Error('getUserMedia is not implemented in this browser'))
                        }
                        // 否则，使用Promise将调用包装到旧的navigator.getUserMedia
                        return new Promise(function (resolve, reject) {
                            getUserMedia.call(navigator, constraints, resolve, reject)
                        })
                    }
                }
                var constraints = {
                    audio: false,
                    video: {width: this.videoWidth, height: this.videoHeight, transform: 'scaleX(-1)'}
                }
                navigator.mediaDevices.getUserMedia(constraints).then(function (stream) {
                    // 旧的浏览器可能没有srcObject
                    if ('srcObject' in _this.thisVideo) {
                        _this.thisVideo.srcObject = stream
                    } else {
                        // 避免在新的浏览器中使用它，因为它正在被弃用。
                        _this.thisVideo.src = window.URL.createObjectURL(stream)
                    }
                    _this.thisVideo.onloadedmetadata = function (e) {
                        _this.thisVideo.play()
                    }
                }).catch(err => {
                    console.log(err)
                })
            },
//  绘制图片（拍照功能）
            setImage() {
                var _this = this
                // 点击，canvas画图
                _this.thisContext.drawImage(_this.thisVideo, 0, 0, _this.videoWidth, _this.videoHeight)
                // 获取图片base64链接
                var image = this.thisCancas.toDataURL('image/png')
                _this.imgSrc = image
                this.$emit('refreshDataList', this.imgSrc)
                this.stopNavigator();
            },
            okImage() {
                console.log("拍照图片Base64")
                console.log(this.imgSrc);
                var filePIC = this.dataURLtoFile(this.imgSrc, "123");
                console.log("图片文件")
                console.log(filePIC);
                var Consult_File = {
                    Id: 0,
                    ConsultId: 0,
                    Code: "string",
                    FilePath: this.imgSrc,
                    ImgType: 0
                }
                this.filePICList.push(Consult_File);

                this.imgSrc = "";
                this.showDialog('')
                // this.getCompetence();
            },
// base64转文件
            dataURLtoFile(dataurl, filename) {
                var arr = dataurl.split(',')
                var mime = arr[0].match(/:(.*?);/)[1]
                var bstr = atob(arr[1])
                var n = bstr.length
                var u8arr = new Uint8Array(n)
                while (n--) {
                    u8arr[n] = bstr.charCodeAt(n)
                }
                return new File([u8arr], filename, {type: mime})
            },
// 关闭摄像头
            stopNavigator() {
                this.thisVideo.srcObject.getTracks()[0].stop()

            },
            //查看附件详情
            handleClickPICItem(row) {
                console.log(row);
                this.imgSrcUrl = this.$getBaseIP()+ row.FilePath;
                console.log("图片路径")
                console.log(this.imgSrcUrl)
                this.showDialog("PIC");
            },
        },
        created() {
            this.msg = this.$route.query;
            console.log("接收过来的传参#############################################################################")
            console.log(this.msg)
            if(this.msg.Token!=null&&this.msg.Token!=""){
                console.log("设置Token")
                this.$setToken(this.msg.Token)
                this.$setItemUrl(this.msg.ItemIP)
            }else{
                console.log("Token为空")
            }
            var loginInfor = localStorage.getItem('LoginInfor');
            this.LoginInfor = JSON.parse(loginInfor);
            console.log("个人登录信息");
            console.log(this.LoginInfor);
            this.getZZJGList();

        }
    };
</script>
<style lang="scss">
    .NumbeRFMaintenMZZZ {
        .selectTime {
            .el-input__icon {
                height: 100%;
                width: 25px;
                display: none;
                text-align: center;
                -webkit-transition: all .3s;
                transition: all .3s;
                line-height: 40px;
            }

            .input {
                width: 90px !important;
                height: 28px !important;
            }


        }
        .selectPic {
            ul {
                padding: 0;
                display: none;
            }
        }

        .camera_outer {
            position: relative;
            overflow: hidden;
            background: #0a1015;
            background-size: 100%;

            video, canvas, .tx_img {
                -moz-transform: scaleX(-1);
                -webkit-transform: scaleX(-1);
                -o-transform: scaleX(-1);
                transform: scaleX(-1);
            }

            .btn_camera {
                position: absolute;
                bottom: 4px;
                left: 0;
                right: 0;
                height: 50px;
                background-color: rgba(0, 0, 0, 0.3);
                line-height: 50px;
                text-align: center;
                color: #ffffff;
            }

            .bg_r_img {
                position: absolute;
                bottom: 0;
                left: 0;
                right: 0;
                top: 0;
            }

            .img_bg_camera {
                position: absolute;
                bottom: 0;
                left: 0;
                right: 0;
                top: 0;

                img {
                    width: 100%;
                    height: 100%;
                }

                .img_btn_camera {
                    position: absolute;
                    bottom: 0;
                    left: 0;
                    right: 0;
                    height: 50px;
                    line-height: 50px;
                    text-align: center;
                    background-color: rgba(0, 0, 0, 0.3);
                    color: #ffffff;

                    .loding_img {
                        width: 50px;
                        height: 50px;
                    }
                }
            }
        }
        .Dilog {
            .column2 {
                width: 1116px;
                margin: 50px auto;
                background: #fff;
                border-radius: 5px;
                position: relative;
            }

            .form-control {
                width: 96px !important;
            }
        }

        .div_P {
            .form-control {
                display: inline-block;
                width: 180px;
                height: 32px;
                padding: 5px 12px;
                font-size: 14px;
                line-height: 1.42857143;
                color: #555;
                background-color: #fff;
                background-image: none;
                border: 1px solid #ccc;
                border-radius: 4px;
                -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
                box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
                -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
                transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
                transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
                transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
            }

            .form-group {
                height: 45px;
                margin: 0;
                line-height: 32px;
                padding: 6px 15px 0 15px;
            }
        }

        .fjtable {
            .el-table {
                font-size: 10px !important;
            }
        }

        .cardP {
            .text {
                font-size: 14px;
            }

            .el-card__header {
                padding: 18px 20px;
                border-bottom: 1px solid #EBEEF5;
                -webkit-box-sizing: border-box;
                box-sizing: border-box;
                background-color: azure;
            }

            .item {
                margin-bottom: 18px;
            }

            .clearfix:before,
            .clearfix:after {
                display: table;
                content: "";
            }

            .clearfix:after {
                clear: both
            }

            .box-card {
                width: 100%;
            }
        }

        .cardC {
            .text {
                font-size: 14px;
            }

            .el-card__header {
                padding: 10px 20px;
                border-bottom: 1px solid #EBEEF5;
                -webkit-box-sizing: border-box;
                box-sizing: border-box;
                background-color: white;
            }

            .el-card__body {
                padding: 8px;
            }

            .item {
                margin-bottom: 18px;
            }

            .clearfix:before,
            .clearfix:after {
                display: table;
                content: "";
            }

            .clearfix:after {
                clear: both
            }

            .box-card {
                width: 100%;
            }
        }

        .el-tree-node.is-current > .el-tree-node__content {
            color: #fff;
            background: #155a00 !important;
        }

        .dRightMain {
            padding: 18px;
        }

        .custom-tree-node {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: space-between;
            font-size: 14px;
            padding-right: 8px;
        }

        .el-table {
            font-size: 14px !important;
        }

        .el-table thead {
            color: #303133;
        }

        .dRightMain .Tb {
            position: absolute;
            top: 91px;
            left: 240px;
            right: 15px;
            bottom: 0;
            border: 1px solid #ddd;
        }
    }

</style>
